﻿<%@ Page Language="C#" MasterPageFile="~/Admin/QuanLy.master" AutoEventWireup="true"
    CodeFile="QuanLyNCC.aspx.cs" Inherits="Admin_QuanLyNCC" Title="Quản lý nhà cung cấp"
    Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="content_t">
        &nbsp;</div>
    <div id="content">
        <div align="center" id="list">
            <h3>
                Danh sách nhà cung cấp</h3>
            <asp:GridView ID="GridView1" SkinID="GridView" runat="server" AutoGenerateColumns="False"
                OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating">
                <Columns>
                    <asp:BoundField DataField="MaNCC" HeaderText="Mã nhà cung cấp" ReadOnly="True">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Tên nhà cung cấp">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("TenNCC") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox1" runat="server" Text='<%# Bind("TenNCC") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Địa chỉ">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("DiaChi") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox2" runat="server" Text='<%# Bind("DiaChi") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Số điện thoại">
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("SoDienThoai") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox3" runat="server" Text='<%# Bind("SoDienThoai") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email">
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox4" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" CancelText="Bỏ" EditText="Sửa" UpdateText="Sửa" />
                    <asp:CommandField ShowDeleteButton="True" DeleteText="Xóa" />
                </Columns>
            </asp:GridView>
        </div>
        <div align="center" id="form">
            <asp:Table ID="tblThem" SkinID="Table" runat="server" Visible="False">
                <asp:TableHeaderRow SkinID="TableHeaderRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        Cập nhật thông tin nhà cung cấp</asp:TableHeaderCell>
                </asp:TableHeaderRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Tên nhà cung cấp
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="TextBox1" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Địa chỉ
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="TextBox2" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Số điện thoại
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="TextBox3" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TextBox3"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                       Email
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="TextBox4" runat="server" Width="200px"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableFooterRow SkinID="TableFooterRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        <asp:Button ID="btnLuuNCC" runat="server" Text="Lưu NCC" OnClick="btnLuuNCC_Click" />
                        <asp:Button ID="btnHuy" runat="server" OnClick="btnHuy_Click" Text="Hủy bỏ" CausesValidation="False" />
                    </asp:TableHeaderCell>
                </asp:TableFooterRow>
            </asp:Table>
            <asp:Button ID="btnThemNCC" runat="server" Text="Thêm nhà cung cấp" OnClick="btnThemNCC_Click"
                CausesValidation="False" />
        </div>
    </div>
    <div id="content_b">
        &nbsp;</div>
</asp:Content>
